package com.gem.controller;

import com.gem.factory.log.LogFactory;
import com.gem.utils.R;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author: Xhy
 * CreateTime: 2022-09-30 15:07
 * 记录房间内的操作日志
 */

@RestController
@RequestMapping("/log")
@CrossOrigin
public class LogController {


    /**
     * 获取房间内的操作日志
     * @param roomId
     * @return
     */
    @GetMapping("/get")
    public R getMessage(String roomId){
        return R.ok().data("data",LogFactory.get(roomId));
    }
}
